<?php
/* Path for included files */
define('PATH', 'http://casabella-html.techusodev.com/', true);

/* Classes */
require_once('class/querymanager.php');
require_once('class/usuarios.php');
require_once('class/agentes.php');
require_once('class/proyectos.php');
require_once('class/propiedades.php');

/* Change page title & description */
function changeData($bufer)
{
	global $pageTitle;
	global $pageDescription;
	
	$buffer = str_replace('{{title}}', $pageTitle, $bufer);
	$buffer = str_replace('{{description}}', $pageDescription, $buffer);

	return $buffer;
}

/* Clip text function */
function clipText($text, $limit)
{
	if(strlen($text) > $limit)
	{
		return substr($text, 0 , $limit).'...';
	}
	else
	{
		return $text;
	}
}

/* Make friendly URL */
function friendlyURL($url)
{
	$separator = '-';
	$url = strtr($url,'áéíóúÁñÑ','aeiouAnN');
	$url = strtolower($url);
	$url = trim(ereg_replace('[^ A-Za-z0-9]','',$url));
	$url = preg_replace('/[\t\n\r\s]+/', $separator, $url);	

	return $url;
}
?>